package com.njegovanobradovic.pages.admin;

import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.hibernate.annotations.CommitAfter;
import org.apache.tapestry5.ioc.annotations.Inject;

import com.njegovanobradovic.entities.Page;
import com.njegovanobradovic.so.Save;

public class Index {
	@Property
	private Page page;
	@Inject
	private Save<Page> savePage;
	
	
	@CommitAfter
	private void onSuccess(){
		try {
			savePage.setObject(page);
			savePage.execute();
		} catch (Exception e) {
			System.out.println("ERROR: "+e);
		}
	}
}
